import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsModelFieldsController } from '../../../controllers';
const uctoocmsModelFieldsRouter = new Router();
const cmsModelFieldsController = new uctooCmsModelFieldsController();

uctoocmsModelFieldsRouter.post('/add', requireUser, cmsModelFieldsController.add);
uctoocmsModelFieldsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_model_fields'), cmsModelFieldsController.edit);
uctoocmsModelFieldsRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_model_fields'), cmsModelFieldsController.delete);

//For getting cmsModelFields with permission control
uctoocmsModelFieldsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_model_fields'), cmsModelFieldsController.getSingle);
uctoocmsModelFieldsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_model_fields'), cmsModelFieldsController.getMany);
uctoocmsModelFieldsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_model_fields'), cmsModelFieldsController.getMany);

//#endregion AutoCreateCode
export default uctoocmsModelFieldsRouter;
